﻿namespace pay.sofort.test
{
    using System.Diagnostics;
    using System.Data.Entity.Infrastructure;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using Models;

    [TestClass]
    public class TestRunOnceSetup : TestBase
    {
        [TestMethod]
        public void CreateDatabase()
        {
            TPaySofortConfig config = TPaySofortConfig.LoadFromFile(ConfigFileName);

            PaySofortContext context = new PaySofortContext(config.ConnectionString, config.Username);
            var dbCreationScript = ((IObjectContextAdapter)context).ObjectContext.CreateDatabaseScript();
            Debug.WriteLine(dbCreationScript);
            // context.Database.ExecuteSqlCommand(dbCreationScript);
            context.SaveChanges();
        }
    }
}
